<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let i = 0;
      for (i; i < 5; i++) {
        setTimeout(() => {
          console.log(i);
        }, 1000);
      }
      console.log(i);

      let obj1 = {
        title: "1",
        id: 2,
      };
      let obj2 = {
        id: 2,
        title: "1",
      };
      console.log(JSON.stringify(obj1), JSON.stringify(obj2), JSON.stringify(obj1) == JSON.stringify(obj2));
      let arr = [
        { id: 1, pid: 1 },
        { pid: 1, id: 1 },
        { id: 2, pid: 1 },
        { id: 3, pid: 1 },
        { id: 6, pid: 1 },
        { id: 3, pid: 1 },
        { id: 6, pid: 1 },
      ];
      let temparr = [...new Set(arr.map((item) => JSON.stringify(item)))];
      let resultArr = temparr.map((item) => JSON.parse(item));
      console.log(resultArr,temparr);
    </script>
  </body>
</html>
